﻿using Prism.Commands;
using Prism.Modularity;
using Prism.Mvvm;
using System.Linq;
using System.Threading.Tasks;

namespace L7_Modularity.ViewModels;

public class MainWindowViewModel : BindableBase
{
    private readonly IModuleManager moduleManager;

    public DelegateCommand LoadModuleCommand { get; set; }

    public MainWindowViewModel(IModuleManager moduleManager)
    {
        LoadModuleCommand = new DelegateCommand(LoadModule);
        this.moduleManager = moduleManager;
        moduleManager.LoadModuleCompleted += ModuleManager_LoadModuleCompleted;
    }

    private void LoadModule()
    {
        moduleManager.LoadModule("ModuleAModule");
        moduleManager.LoadModule("ModuleBModule");
    }

    private void ModuleManager_LoadModuleCompleted(object sender, LoadModuleCompletedEventArgs e)
    {

    }
}